package com.howso.cloud.ddd.domain;

import lombok.Builder;
import lombok.Data;


@Data
@Builder
public class PageInfo {
    private Integer page;
    private Integer size;
    private Integer totalElements;
    private Integer totalPages;

    public int getTotalPages() {
        return getSize() == 0 ? 1 : (int) Math.ceil((double) totalElements / (double) getSize());
    }
}
